<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const p1=new Promise((resolve,rej)=>{
          setTimeout(() => {
              console.log('第一个请求发送成功');
              resolve()
          }, 2000);
        })
        const p2=new Promise((resolve,rej)=>{
          setTimeout(() => {
              console.log('第二个请求发送成功');
              resolve()
          }, 5000);
        })
        // Promise.all([p1,p2]).then(() => {
        //   console.log('两个请求都发送成功啦');
        // })
        ;(async() => {
          await Promise.all([p1,p2])
          console.log('两个请求都发送成功啦');
        })()
    </script>
</body>
</html>